var Dish = Backbone.Model.extend({
    initialize: function () {
		// this.tags = new TagCollection();
		// this.tags.view = new TagCollectionView({model: this.tags});
	
		// save for later refresh of TagCollectionView
		// this.rawTagList = _.map(spec.tags, function(tag) { 
			// return new Tag({ name: tag["name"], id: tag["id"] });
		// });

        // we may also want to store something else as an attribute
        // for example a unique ID we can use in the HTML to identify this
        // item's element. We can use the models 'cid' or 'client id for this'.
        this.set({
            htmlId: 'dish_' + this.cid
        });
    },
	
	parse: function(response) {
		// use JSON returned by django view to construct a dish object
		var dishes = _.map(response, ParseDishes);
		return dishes;
	},
});

var Review = Backbone.Model.extend({
    initialize: function (spec) {

        // we may also want to store something else as an attribute
        // for example a unique ID we can use in the HTML to identify this
        // item's element. We can use the models 'cid' or 'client id for this'.
        this.set({
            htmlId: 'review_' + this.cid
        });
    },
	
	parse: function(response) {
		// use JSON returned by django view to construct a dish object
		var reviews = _.map(response, ParseReviews);
		return reviews;
	},
});

